package com.hitqz.robot.arm.constant;

import java.util.HashMap;
import java.util.Map;

public enum RealManJointErrorEnum {

    NORMAL(0x0000, "关节正常"),

    ERROR1(0x0001, "FOC 错误"),

    ERROR2(0x0002, "过压"),

    ERROR3(0x0004, "欠压"),

    ERROR4(0x0008, "过温"),

    ERROR5(0x0010, "启动失败"),

    ERROR6(0x0020, "初始化定位失败"),

    ERROR7(0x0040, "过流"),

    ERROR8(0x0080, "软件错误"),

    ERROR9(0x0100, "温度传感器错误"),

    ERROR10(0x0200, "位置传感器错误"),

    ERROR11(0x0400, "驱动芯片错误"),

    ERROR12(0x0800, "位置跟踪错误"),

    ERROR13(0x1000, "电流检测错误"),

    ERROR14(0x2000, "抱闸打开失败"),

    ERROR15(0x8000, "温升异常"),

    ERROR16(0xF000, "通信丢帧"),

            ;

    public static Map<Integer, String> JOINT_ERROR =new HashMap<>(16);


    static {
        for (RealManJointErrorEnum value: values()) {
            RealManJointErrorEnum.JOINT_ERROR.put(value.key, value.name);
        }
    }

    private final Integer key;

    private final String name;

    RealManJointErrorEnum(Integer key, String name) {
        this.key = key;
        this.name = name;
    }

    public Integer getKey() {
        return key;
    }

    public String getName() {
        return name;
    }


}
